import {Commit} from 'vuex'
/**
 * 获取当前设备所处浏览器环境,判断当前环境是支付宝还是微信
 */
export function getMobileInfo() {
    const info = window.navigator.userAgent.toLowerCase();
    if (info.indexOf('micromessenger') > 0) {
        return 'WxPay'
    }
    if (info.indexOf('alipayclient') > 0) {
        return 'AiPay'
    }
}

/**
 * set user windows title
 * @param name windows Name
 */
export function setWindowsName(name = "窗口标题") {
    const windowsTitleName = window.document.getElementsByTagName('title')[0]
    windowsTitleName.innerText = name
}